package demo1;

import java.util.Arrays;

//class Student1 implements Comparable<Student>{
//    public String name;
//    public double chinese;
//    public double english;
//    public double math;
//    //总分
//    public double score;
//    public Student1(String name ,double chinese, double english, double math) {
//        this.name = name;
//        this.chinese = chinese;
//        this.english = english;
//        this.math = math;
//        this.score = chinese + english + math;
//    }
//    @Override
//    public int compareTo(Student o) {
//        return (int)(this.score - o.score);
//    }
//    @Override
//    public String toString() {
//        return "Student{" +
//                "name='" + name + '\'' +
//                ", score=" + score +
//                '}';
//    }
//}
//public class test1 {
//    public static void main(String[] args) {
//        Student[] students = {
//                new Student("张三",52.0,68.6,98.2),
//                new Student("李四",89.5,36.5,82.5),
//                new Student("王五",95.0,75.8,56.2)
//        };
//        Arrays.sort(students);
//        System.out.println(Arrays.toString(students));
//    }
//}
